/*
 * Copyright (C) 2008-2011 CBDP Consortium
 * 
 * All rights reserved.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.
 * 
 * This software consists of contributions made by many individuals, 
 * listed below:
 *
 * Author: 	Xabier Laiseca <xabier.laiseca@deusto.es>
 * 			David Ausín <david.ausin@deusto.es>
 */
package cbdp.server.contextreasoner.configuration.model;

import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;

/**
 * @author Xabier Laiseca
 */
public class Configuration
{
	//Key: the name of the ontology
	//Value: the location of the ontology
	private TreeMap<String, String> ontologyLocations = new TreeMap<String, String>();
	
	private String mappingFileLocation;
	private String storageConfigurationFileLocation;
	private StorageType storageType;
	private String reasonerClassName;
	
	private String ontologySpecClassName;
	private String ontologySpecAttributeName;
	

	public Map<String, String> getOntologyLocations()
	{
		return Collections.unmodifiableMap(ontologyLocations);
	}
	
	public void addOntologyLocation(final String ontologyName, final String ontologyLocation)
	{
		ontologyLocations.put(ontologyName, ontologyLocation);
	}

	public String getMappingFileLocation()
	{
		return mappingFileLocation;
	}

	public void setMappingFileLocation(final String mappingFileLocation)
	{
		this.mappingFileLocation = mappingFileLocation;
	}

	public void setStorageConfigurationFileLocation(final String storageConfigurationFileLocation)
	{
		this.storageConfigurationFileLocation = storageConfigurationFileLocation;
	}

	public String getStorageConfigurationFileLocation()
	{
		return storageConfigurationFileLocation;
	}
	
	public void setStorageType(final String storageTypeString)
	{
		this.storageType = StorageType.valueOf(storageTypeString.toUpperCase());
	}
	
	public StorageType getStorageType()
	{
		return storageType;
	}

	public String getReasonerClassName()
	{
		return reasonerClassName;
	}

	public void setReasonerClassName(final String reasonerClassName)
	{
		this.reasonerClassName = reasonerClassName;
	}
	
	public String getOntologySpecClassName()
	{
		return ontologySpecClassName;
	}

	public void setOntologySpecClassName(String ontologySpecClassName)
	{
		this.ontologySpecClassName = ontologySpecClassName;
	}

	public String getOntologySpecAttributeName()
	{
		return ontologySpecAttributeName;
	}

	public void setOntologySpecAttributeName(final String ontologySpecAttributeName)
	{
		this.ontologySpecAttributeName = ontologySpecAttributeName;
	}
	
	public enum StorageType
	{
		MEMORY,
		SDB,
		TDB;
	}
}
